package com.automannn.atm_back.modules.codeGenerator.service.impl;

import com.automannn.atm_back.modules.codeGenerator.entity.GlobalConfigGroupEntity;
import com.automannn.atm_back.modules.codeGenerator.mapper.GlobalConfigGroupEntityMapper;
import com.automannn.atm_back.modules.codeGenerator.service.GlobalConfigGroupEntityService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* (GeneratorGlobalConfigGroup)表服务实现类
*
* @author chenkaihai
* @since 2020-07-12 17:00:45
*/
@Service
public class GlobalConfigGroupEntityServiceImpl implements GlobalConfigGroupEntityService {
    @Resource
    private GlobalConfigGroupEntityMapper globalConfigGroupEntityMapper;


    /**
    * 查询一个对象
    *
    * @param  id
    * return 实例对象
    */
    @Override
    public GlobalConfigGroupEntity queryOne(String id) {
        return this.globalConfigGroupEntityMapper.queryById(id);
    }

    /**
    * 查询所有对象
    *
    * return 实例对象
    */
    @Override
    public IPage<GlobalConfigGroupEntity> queryAll(Page<GlobalConfigGroupEntity> page, GlobalConfigGroupEntity generatorGlobalConfigGroup) {
        return this.globalConfigGroupEntityMapper.queryAll(page,generatorGlobalConfigGroup);
    }

    /**
    * 新增数据
    *
    * @param generatorGlobalConfigGroup 实例对象
    * @return 实例对象
    */
    @Override
    public GlobalConfigGroupEntity insert(GlobalConfigGroupEntity generatorGlobalConfigGroup) {
        this.globalConfigGroupEntityMapper.insert(generatorGlobalConfigGroup);
        return generatorGlobalConfigGroup;
    }

    /**
    * 修改数据
    *
    * @param generatorGlobalConfigGroup 实例对象
    * @return 实例对象
    */
    @Override
    public void update(GlobalConfigGroupEntity generatorGlobalConfigGroup) {
        globalConfigGroupEntityMapper.update(generatorGlobalConfigGroup);
    }

    /**
    * 通过主键删除数据
    *
    * @param id 主键
    * @return 是否成功
    */
    @Override
    public boolean deleteById(String id) {
        return this.globalConfigGroupEntityMapper.deleteById(id) > 0;
    }
}
